<template>
  <div>
      <h1>fahter组件--父组件</h1>
      <p>{{ name }}</p>
      <son ref="son" />
  </div>
</template>

<script>
import son from './son'
export default {
    components: {
        son
    },
    data() {
        return {
            timer: null,
            name: 'jack'
        }
    },
    created () {
        this.timer = setInterval(() => {
            console.log('我是father里开启的定时器')
        }, 1000);
    }, 
    beforeDestroy () {
        clearInterval(this.timer)
        console.log('father销毁前', this.$refs.son)
    },

    destroyed () {
        console.log('father销毁后', this.$refs.son)
    }
}
</script>

<style>

</style>